import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ListComponent } from './list/list.component';
import { AddComponent } from './add/add.component';
import { ListService } from './services/list.service';
import { EditService } from './services/edit.service';
import { AddService } from './services/add.service';
import { DetailComponent } from './detail/detail.component';
import { CanActiveSuperAdmin } from 'app/core/auth/can-active-super-admin';

const routes: Routes = [
  {
    path: '',
    data: { title: '管理员设置' },
    children: [
      { path: '', component: ListComponent, resolve: { data: ListService } },
      {
        path: 'add',
        component: AddComponent,
        resolve: { list: AddService },
        data: { title: '添加管理员' },
      },
      {
        path: 'detail/:name',
        component: DetailComponent,
        runGuardsAndResolvers: 'always',
        resolve: { data: EditService },
        data: { title: '管理员详情' },
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class AdminManagerRoutingModule {}
